package com.jcli._java_swing_入门教程pdf.ch17;

import javax.swing.*;
import java.awt.*;

/**
 * @author li
 * @version 1.0
 * @belongsProject novel_20230923
 * @belongsPackage com.jcli._java_swing_入门教程pdf.ch17
 * @className BorderLayoutDemo
 * @description TODO  布局管理器-边框布局管理器
 * @createTime 2024-01-15  00:30
 */
public class BorderLayoutDemo {
    public static void main(String[] args) {
        JFrame jf = new JFrame("Java第三个GUI程序");
        jf.setSize(400,200);

        jf.setLayout(new BorderLayout());
        jf.setVisible(true);
        jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JButton bt1 = new JButton("上 North");
        JButton bt2 = new JButton("下 South");
        JButton bt3 = new JButton("左 West");
        JButton bt4 = new JButton("右 East");
        JButton bt5 = new JButton("中 Center");
        jf.add(bt1,BorderLayout.NORTH);
        jf.add(bt2,BorderLayout.SOUTH);
        jf.add(bt3,BorderLayout.WEST);
        jf.add(bt4,BorderLayout.EAST);
        // jf.add(bt5,BorderLayout.CENTER);
        jf.setBounds(600,150,400,400);

    }
}
